package com.ch05;

public class SunLightCorrected {
		public static void main(String[] args) {
		// Distance from sun (150 million kilometers)
		long kmFromSun = 150000000;
		long lightSpeed = 299792458; // meters per second
		// Convert distance to meters.
		long mFromSun = kmFromSun * 1000;
		long seconds = mFromSun / lightSpeed;
		System.out.print("Light will use ");
		printTime(seconds);
		System.out.println(" to travel from the sun to the earth.");
		}
		public strictfp static void printTime(long sec) {
		long min = sec / 60;
		sec = sec - (min * 60);
		System.out.print(min + " minute(s) and " + sec + " second(s)");
		}
}
